Dynomotion

Group: DynoMotion Message: 6112 From: daveymahomh600e Date: 11/18/2012
Subject: Storing Probe Coordinate Values
Hello Tom,

As I have previously noted, I am still learning C programming and could use some guidance with regard to storing the positional data from a probing operation.

The data I want to store is simple X and Y axis positions for each trigger of the probe. If I assign a value to variables Xcoord and Ycoord, what is the best way to fprintf this data to a file...

1) open the file prior to the probing loop and add the data from each trigger point within the loop, then close the file after the loop, or

2) open the file, add the data and close the file within the loop?

Is there a way to allow the operator to specify a filename within which to store the data, or is it best to overwrite an existing file? I ask this because I don't yet fully understand how old data would be overwritten or appended with the fprintf function.

Any code snippets would be greatly appreciated.

Thank you for your help,
David.
Group: DynoMotion Message: 6118 From: Tom Kerekes Date: 11/18/2012
Subject: Re: Storing Probe Coordinate Values
Hi David,

I would think opening a file before the loop, writing data within the loop, then closing the file after the loop would be the simplest.

See the example:

CaptureXYZMotionToFile.c

That example first captures data to KFLOP's 8 MByte gather buffer, then writes all the data at once.

If a file is re-opened it will be erased.

There isn't an easy way to pass a file name string from GCode to KFLOP.  You could pass a number to then form a string such as data_file_N.

HTH
Regards
TK


Group: DynoMotion Message: 6119 From: daveymahomh600e Date: 11/19/2012
Subject: Re: Storing Probe Coordinate Values
Hi Tom,

The example file should get me on the right track. I didn't realize there was buffer that would store data.

Thank you,
David.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> I would think opening a file before the loop, writing data within the loop, then closing the file after the loop would be the simplest.
>
> See the example:
>
> CaptureXYZMotionToFile.c
>
> That example first captures data to KFLOP's 8 MByte gather buffer, then writes all the data at once.
>
> If a file is re-opened it will be erased.
>
>
> There isn't an easy way to pass a file name string from GCode to KFLOP.  You could pass a number to then form a string such as data_file_N.
>
> HTH
> Regards
> TK
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, November 18, 2012 6:22 AM
> Subject: [DynoMotion] Storing Probe Coordinate Values
>
>
>  
> Hello Tom,
>
> As I have previously noted, I am still learning C programming and could use some guidance with regard to storing the positional data from a probing operation.
>
> The data I want to store is simple X and Y axis positions for each trigger of the probe. If I assign a value to variables Xcoord and Ycoord, what is the best way to fprintf this data to a file...
>
> 1) open the file prior to the probing loop and add the data from each trigger point within the loop, then close the file after the loop, or
>
> 2) open the file, add the data and close the file within the loop?
>
> Is there a way to allow the operator to specify a filename within which to store the data, or is it best to overwrite an existing file? I ask this because I don't yet fully understand how old data would be overwritten or appended with the fprintf function.
>
> Any code snippets would be greatly appreciated.
>
> Thank you for your help,
> David.
>